package com.ori.dao;

import com.ori.pojo.Flysysuser;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.support.SqlSessionDaoSupport;

/**
 * mybatis整合Spring原始dao方式开发，
 * 整合后，将SqlSessionFactory，交给Spring管理
 * 我们只需要继承mybatis-spring组合依赖包中的SqlSessionDaoSupport
 *
 *
 * @author Pretty·Boy
 * @date 2018/12/23 11:03
 */
public class UserDaoImpl extends SqlSessionDaoSupport implements UserDao {
    @Override
    public Flysysuser getUserByid(int id) {
        //调用父类中方法getSqlSession()，获取sqlSession
        SqlSession sqlSession = getSqlSession();
        Flysysuser user = sqlSession.selectOne("getUserById", 9);
        return user;
    }
}
